import request from "../common/request";
// 修改密码
export function editPass(data) {
  console.log(data, "传递的参数");
  return request.request({
    url: `/mobile/rest-pwd`,
    method: "post",
    data: data,
  });
}
// 退出登录
export function logOut(data) {
    // console.log(data, "传递的参数");
    return request.request({
      url: `/logout`,
      method: "post",
      data: data,
    });
  }
  //养殖场首页 待缴费和已缴费 http://127.0.0.1:20001/farm/payNum
export function needMonney(data) {
  return request.request({
    url: `/farm/payNum`,
    method: "post",
  });
}
// 已加入系统xx天
export function days(data) {
  return request.request({
    url: `/common-api/days`,
    method: "get",
    data: data,
  });
}
//今日已收集牛粪、污水统计
export function collect(data) {
  return request.request({
    url: `/dispatcher-stats/today-dung-sewage`,
    method: "get",
    data: data,
  });
}
//预计待收集牛粪污水统计
export function estimated(data) {
  return request.request({
    url: `/dispatcher-stats/estimated-dung-sewage`,
    method: "get",
    data: data,
  });
}
//当前收运车辆统计
export function stats(data) {
  return request.request({
    url: `/dispatcher-stats/current-vehicle`,
    method: "get",
    data: data,
  });
}
//当前任务统计
export function task(data) {
  return request.request({
    url: `/dispatcher-stats/current-task`,
    method: "get",
    data: data,
  });
}
// 图表-周
// export function eChartsWeek(data) {
//   return request.request({
//     url: `/dispatcher-stats/week`,
//     method: "get",
//     data: data,
//   });
// }
// // 图表-月
// export function eChartsMonth(data) {
//   return request.request({
//     url: `/dispatcher-stats/month`,
//     method: "get",
//     data: data,
//   });
// }
// // 图表-年
// export function eChartsYear(data) {
//   return request.request({
//     url: `/dispatcher-stats/year`,
//     method: "get",
//     data: data,
//   });
// }
  //调度员选择有机质类型
  export function dispatchOrganic(data) {
    return request.request({
      url: '/dispatcher-stats/organic-type',
      method: 'get',
      data,
    })
  }
//调度员图表
export function dispatcherEcharts(data) {
  return request.request({
    url: `/dispatcher-stats/transport?type=${data.type}&organicType=${data.organicType}`,
    method: "get",
    data: data,
  });
}
// 已接受工单
export function workNum(data) {
  return request.request({
    url: `/vehicle/totalOrder`,
    method: "get",
    data: data,
  });
}
// 待接工单-/vehicle/newOrderNumber
export function ordNum(data) {
  return request.request({
    url: `/vehicle/newOrderNumber`,
    method: "get",
    data: data,
  });
}
// 登录-
export function logins(data) {
  return request.request({
    url: `/mobile-login`,
    method: "post",
    data: data,
  });
}
// 养殖场首页 
export function farmIndex(data) {
  return request.request({
    url: `/farm/organic-weight`,
    method: "post",
    data: data,
  });
}
// 养殖场首页图表-
export function farmEcharts(data) {
  return request.request({
    url: `/farm/data-icon`,
    method: "post",
    data: data,
  });
}
// 养殖场预约记录 /farm/getOrder
export function farmOrder(data) {
  return request.request({
    url: `/appoint/listOutPage`,
    method: "post",
    data: data,
  });
}
// 养殖场取消预约 /farm/cancelOrder?id=
export function farmCancelOrder(data) {
  return request.request({
    url: `/farm/cancelOrder?id=${data}`,
    method: "post",
    data: data,
  });
}
//获取预约详情 /farm/getOrderDetails?id=
export function orderDetail(data) {
  return request.request({
    url: `/farm/getOrderDetails?id=${data}`,
    method: "post",
    data: data,
  });
}
// 有机质列表 
export function organicType(data) {
  return request.request({
    url: `/farm/getOrganicType`,
    method: "post",
    data: data,
  });
}
// 派发工单
// 车辆列表 optionList
export function optionList(data) {
  return request.request({
    url: `/vehicle/distributable-list`,
    method: "get",
    data: data,
  });
}
// 派发
export function addSend(data) {
  return request.request({
    url: `/work-order/add-manual`,
    method: "post",
    data: data,
  });
}
// 养殖户列表 farmList
export function farmList(data) {
  return request.request({
    url: `/farm/option-list`,
    method: "get",
    data: data,
  });
}
//上传文件
// export function upload(data) {
//   return request.request({
//     url: `/farm/option-list`,
//     method: "get",
//     data: data,
//   });
// }
//全部司机列表 /driver//listOutPage
export function driverLists(data) {
  return request.request({
    url: `/driver/listOutPage`,
    method: "post",
    data: data,
  });
}
//养殖场首页费用 /farm/money-total
export function farmMonery(data) {
  return request.request({
    url: `/farm/money-total`,
    method: "post",
    data: data,
  });
}
//养殖场方块 /common-api/today-collect?userType=xxx
export function farmBord(data) {
  return request.request({
    url: `/common-api/today-collect?userType=${data}`,
    method: "get",
    data: data,
  });
}
//实验助手-最新反馈时间 /experimenter-stats/last-feedback-time
export function lastTime(data) {
  return request.request({
    url: `/experimenter-stats/last-feedback-time`,
    method: "get",
    data: data,
  });
}
//总累计 /experimenter-stats/total
export function experTotal(data) {
  return request.request({
    url: `/experimenter-stats/total`,
    method: "get",
    data: data,
  });
}
//待开始 /experimenter-stats/current
export function experCurrent(data) {
  return request.request({
    url: `/experimenter-stats/current`,
    method: "get",
    data: data,
  });
}
//实验类型列表 /experimenter-stats/category
export function experCategory(data) {
  return request.request({
    url: `/experimenter-stats/category`,
    method: "get",
    data: data,
  });
}
// 列表
export function typeList(data) {
  return request.request({
    url: '/constant/getAllConstant',
    method: 'post',
    data,
  })
}
// 展示具体常量值
export function detail(data) {
  return request.request({
    url: `/constant/getSpecificConstant?id=${data.id}`,
    method: 'post',
    // data,
  })
}
//获取路线JSOn /map/driving-route?ids=${data}
export function getMapJSON(data) {
  return request.request({
    url: `/map/driving-route?ids=${data}`,
    method: "get",
    data: data,
  });
}
//获取最近的养殖户距离 http://127.0.0.1:20001/vehicle/getNearFarm
export function getNearFarm(data) {
  return request.request({
    url: `/vehicle/getNearFarm`,
    method: "post",
    data: data,
  });
}
///vehicle/driver-count
export function driverCount(data) {
  return request.request({
    url: `/driver-stats/transport?type=${data}`,
    method: "get",
    data: data,
  });
}
export function taskList(data) {
  return request.request({
    url: `/vehicle/newWorkOrder`,
    method: "post",
    data: data,
  });
}